# -*- coding: utf-8 -*-

from w.blocks.block import Block
from w.blocks.ulist import UList
from w.blocks.containers.menu import Menu as MenuContainer

from w.html.doctypes.preferable import A, P

class Menu(UList):
    scriptFiles = ['/w/blocks/menu.js']

    def __init__(self, content=None, *argv, **kwargv):
        if isinstance(content, dict):
            content = content.items()

        UList.__init__(self, content, *argv, **kwargv)

    def make(self, content=[]):
        if not content:
            content = self
        return UList.make(self, [A(P(name), hhref=url) for name, url in content])

